﻿using Microsoft.AspNetCore.Http;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Framework.Core.Serilog
{
    /// <summary>
    /// 
    /// </summary>
    public class LogEntityRequest
    {
        /// <summary>
        /// Id
        /// </summary>
        public long Id { get; set; }  
        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 日志对象类型
        /// </summary>
        public string LogObjType { get; set; }
        /// <summary>
        /// 日志对象类型别名
        /// </summary>
        public string LogObjTypeAlias { get; set; }
        /// <summary>
        /// 日志级别
        /// </summary>
        public LogEventLevel Level { get; set; }
        /// <summary>
        /// 操作类型
        /// </summary>
        public string OperationType { get; set; }
        /// <summary>
        /// 操作名
        /// </summary>
        public string OperationName { get; set; }
        /// <summary>
        /// 操作者id
        /// </summary>
        public long OperatorId { get; set; }
        /// <summary>
        /// 服务端机器唯一标记
        /// </summary>
        public string ServerMark { get; set; } = Environment.MachineName;
        /// <summary>
        /// HttpRequest
        /// </summary>
        public HttpRequest Request { get; set; }=null;
        /// <summary>
        /// 
        /// </summary>
        public int DeleteFlag { get; set; } = 0;
        /// <summary>
        /// 
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime UpdateTime { get; set; }
    }
    /// <summary>
    /// 日志操作类型
    /// </summary>
    public enum LogOperationType
    {
        /// <summary>
        /// 增
        /// </summary>
        Insert = 1,
        /// <summary>
        /// 删
        /// </summary>
        Delete = 2,
        /// <summary>
        /// 改
        /// </summary>
        Update = 3,
        /// <summary>
        /// 查
        /// </summary>
        Query = 4,
        /// <summary>
        /// 导入
        /// </summary>
        Import= 5,
        /// <summary>
        /// 导出
        /// </summary>
        Export = 6,
        /// <summary>
        /// 登录
        /// </summary>
        Login = 7,
        /// <summary>
        /// 其它
        /// </summary>
        Other = 8

    }
}
